package com.cntcdt.api.db.model.base;

import java.io.Serializable;
import java.sql.ResultSet;
import java.util.Date;

/**
 * 这是admin_user_group的数据传输对象基类，直接与表对应
 */
public abstract class AdminUserGroupModelBase implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * 属性：id
	 */
	private Integer id;
	/**
	 * 属性：groupName
	 */
	private String groupName;
	/**
	 * 属性：addTime
	 */
	private Date addTime;

	/**
	 * 默认构造函数
	 */
	public AdminUserGroupModelBase() {
	}

	public AdminUserGroupModelBase(ResultSet rs) {
		try {
			this.id = rs.getInt("id");
			this.groupName = rs.getString("groupName");
			this.addTime = rs.getDate("addTime");
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getGroupName() {
		return groupName;
	}

	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}

	public Date getAddTime() {
		return addTime;
	}

	public void setAddTime(Date addTime) {
		this.addTime = addTime;
	}

	/**
	 * 比较两个对象在逻辑上是否相等
	 * 
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof AdminUserGroupModelBase)) {
			return false;
		}

		final AdminUserGroupModelBase otherModel = (AdminUserGroupModelBase) other;
		if (getId() != null && !getId().equals(otherModel.getId())) {
			return false;
		}
		return true;
	}

	/**
	 * 根据主键生成HashCode
	 * 
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		StringBuffer buffer = new StringBuffer();
		buffer.append('|').append(id);
		return buffer.toString().hashCode();
	}
}
